import { SystemComponent } from './system.component';
import { ConfigComponent } from './config/config.component';
import { SysinfoComponent } from './sysinfo/sysinfo.component';
import { SysinfoDetailComponent } from './sysinfo/sysinfo-detail.component';
import { ResourceComponent } from './resource/resource.component';
import { DictComponent } from './dict/dict.component';
import { RoleComponent } from './role/role.component';
import { RoleListComponent } from './role/role-list.component';
import { RoleInfoComponent } from './role/role-info.component';
import { UnitComponent } from './unit/unit.component';
import { HumanComponent } from './human/human.component';
import { HumanListComponent } from './human/human-list.component';
import { HumanInfoComponent } from './human/human-info.component';
import { UnitDetailComponent } from './unit/unit-detail.component';
import { AuthorityGuard } from '../common/interceptor/authority.guard';

export const systemRoutes = [
    {
        path: '',
        canActivateChild: [AuthorityGuard],
        component: SystemComponent,
        children: [
            /** 默认跳转界面 **/
            { path: '', redirectTo: 'sysinfo/detail', pathMatch: 'full' },
            /**  系统配置  **/
            {
                path: 'sysinfo',
                canActivateChild: [AuthorityGuard],
                component: SysinfoComponent,
                children: [
                    { path: '', pathMatch: 'full' },
                    { path: 'detail', component: SysinfoDetailComponent, pathMatch: 'prefix' }
                ]
            },
            /**  资源配置  **/
            {
                path: 'resource', component: ResourceComponent
            },
            /**  参数配置  **/
            {
                path: 'config', component: ConfigComponent
            },
            /**  数据字典配置  **/
            {
                path: 'dict', component: DictComponent
            },
            /**  机构岗位配置  **/
            {
                path: 'role',
                canActivateChild: [AuthorityGuard],
                component: RoleComponent,
                children: [
                    { path: '', pathMatch: 'full' },
                    { path: 'list', component: RoleListComponent },
                    { path: 'info', component: RoleInfoComponent }
                ]
            },
            /**  组织机构配置  **/
            {
                path: 'unit', component: UnitComponent,
                children: [
                    { path: '', pathMatch: 'detail' },
                    { path: 'detail', component: UnitDetailComponent },
                ]
            },
            /**  机构人员配置  **/
            {
                path: 'human',
                component: HumanComponent,
                children: [
                    { path: '', redirectTo: 'list', pathMatch: 'full' },
                    { path: 'list', component: HumanListComponent },
                    { path: 'info', component: HumanInfoComponent }
                ]
            }
        ]
    }
];
